package com.cloud.pole.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloud.pole.api.user.BaseUserApi;
import com.cloud.pole.api.user.UserAuthorizedWxApi;
import com.cloud.pole.common.constant.ApiConstant;
import com.cloud.pole.common.msg.ApiRestResponse;

/*
*2019年2月21日
*cloud-shop
*author:frank-chen
*/
@FeignClient(value = ApiConstant.USER_SERVICE_ID)
public interface IUserService {
	
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_CHECKPAYPWD, method = RequestMethod.GET)
	 public ApiRestResponse<Boolean> checkPayPwd(
			@RequestParam(name="token", defaultValue = "") String token,
			@RequestParam(name="payPwd", defaultValue = "") String payPwd);
	 
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_GETBASEUSER, method = RequestMethod.GET)
	 public ApiRestResponse<BaseUserApi> getBaseUser(
				@RequestParam(name="token", defaultValue = "") String token);
	 
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_GETUSERAUTHORIZEDWX, method = RequestMethod.GET)
	 public ApiRestResponse<UserAuthorizedWxApi> getUserAuthorizedWx(
   		  @RequestParam(name="token", defaultValue = "") String token,
   		  @RequestParam(name="wxAppId", defaultValue = "") Integer wxAppId);
	 
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_GETUSERBYMOBILE, method = RequestMethod.GET)
	 public ApiRestResponse<BaseUserApi> getUserByMobile(
   		  @RequestParam(name="mobileArea", defaultValue = "86") String mobileArea,
   		  @RequestParam(name="mobile", defaultValue = "") String mobile); 
	 
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_WXUSERBIND, method = RequestMethod.GET)
	 public ApiRestResponse<BaseUserApi> wxUserBind(
   		  @RequestParam(name="mobileArea", defaultValue = "86") String mobileArea,
   		  @RequestParam(name="mobile", defaultValue = "") String mobile,
   		  @RequestParam(name="openId", defaultValue = "") String openId,
   		  @RequestParam(name="userType", defaultValue = "") Integer userType); 
	 
	 @RequestMapping(value=ApiConstant.USER_SERVICE_USER_GETUSERBYMARKETCODE, method = RequestMethod.GET)
	 public ApiRestResponse<BaseUserApi> getUserByMarketCode(
   		  @RequestParam(name="marketCode", defaultValue = "") String marketCode); 
}
